<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>图片浏览</title>
<link rel="stylesheet" href="<!--{$CSSURL}-->common.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<!--{$JSURL}-->galleryView/css/jquery.galleryview-3.0-dev.css" type="text/css" media="screen" />
<script src="<!--{$JSURL}-->jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="<!--{$JSURL}-->galleryView/js/jquery.easing.1.3.js" type="text/javascript"></script> 
<script src="<!--{$JSURL}-->galleryView/js/jquery.timers-1.2.js" type="text/javascript"></script> 
<script src="<!--{$JSURL}-->galleryView/js/jquery.galleryview-3.0-dev.js" type="text/javascript"></script> 
<script type="text/javascript"> 
$(document).ready(function(){
	$('#basic').galleryView({
		panel_width: 950,
		panel_height: 600,
		frame_width: 120,
		frame_height: 90,
        show_overlays: true
	});
	
	$(".setDefault").click(function(){
		var id = $("#photoId").text();
		if (id != ''){
			var idArr = id.split('_');
			$.post('<!--{$SITEURL}-->' + '/?c=user&a=setDefaultPic', {"id":idArr[1]} , function(data){
				var dataArr = data.split("|");
				if (dataArr[0] == 0){
					$(".setDefault").hide();
					$("#defaultPicId").text(idArr[1]);
				} else {
					alert(dataArr[1]);
				}
			});
		} else {
			alert('对不起，出现错误了！');
		}
	});
	$(".delPic").click(function(){
		if ( confirm("确认删除吗？") ){
			var id = $("#photoId").text();
			if (id != ''){
				var idArr = id.split('_');
				$.post('<!--{$SITEURL}-->' + '/?c=picture&a=deletePic', {"id":idArr[1]} , function(data){
					var dataArr = data.split("|");
					if (dataArr[0] == 0){
						location.reload();
					} else {
						alert(dataArr[1]);
					}
				});
			} else {
				alert('对不起，出现错误了！');
			}
		}
	});
});
</script>
</head>
<body>
	<!--{include file='header.htm'}-->
	<div class="wrap">
		<div class="clear"></div>
		<div class="showPhoto">
			<div id="basic" class="svwp">
			    <ul>
			    <!--{section name=p loop=$picList}-->
			    <li><img id="photo_<!--{$picList[p].pid}-->" data-description="<!--{$picList[p].tag}-->" alt="<!--{$picList[p].picture_name}-->" src="<!--{$ATTACHMENTURL}--><!--{$picList[p].picture_address}-->" /></li>
			    <!--{sectionelse}-->
			    <li><img id="photo_0" data-description="默认图片" alt="默认图片" src="<!--{$IMAGEURL}-->noPicture.jpg" /></li>
			    <!--{/section}-->
			    </ul>
		    </div>
		    <div id="photoId" style="display:none;"></div>
		    <div id="defaultPicId" style="display:none;"><!--{$defaultPicId}--></div>
			<div class="setDefault">设为默认</div>
			<div class="delPic">删除</div>
		</div>
		<!--{include file='footer.htm'}-->
	</div>
</body>
</html>